using System;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;

namespace FW
{
    public partial class Player :EntityLogicBase
    {
        public KeyMouseInput keyInput;

        public ArtContorller artContorller;

        public GameObject model;

        //装备界面
        public List<int> LeftWepons;
        public List<int> RightWepons;
        public List<int> Amulets;
        public List<int> Items;
        

        //战斗界面
        public int LeftWeponId;
        public int RightWeponId;
        public int MagicId;
        public int ItemId;

        //初始化使用
        public void InitWeapon()
        {
            LeftWeponId = 0;
            RightWeponId = 1;
            LeftWepons = new List<int>();
            RightWepons = new List<int>();
            Amulets = new List<int>();
            Items = new List<int>();
        }

        //从存档读出来
        public void LoadWeapon()
        {

        }

        public void Awake()
        {
            base.OnInit();
            InitWeapon();
            keyInput = new KeyMouseInput(this);
            artContorller = transform.GetComponent<ArtContorller>();
            model = this.transform.Find("render").Find("ybot").gameObject;
            artContorller.Init(this.transform);
            state = EPLAYERSTATE.IDLE;
        }

        

        public void UpdateState()
        {

        }

        public void Update()
        {
            onGroundSensor.DoUpdate();
            keyInput.DoUpdate();
            this.UpdateState();
            //这里接一个玩家目前状态
            artContorller.DoUpdate();
            MoveAndJump(model, keyInput);


        }
    }
}